package ManagerImage;


import javafx.application.Application;
import javafx.application.Platform;
import javafx.scene.Scene;
import javafx.stage.Stage;
import  ManagerImage.display.RootPane;
public class Main extends Application {
    public void start(Stage stage) {
        RootPane root = new RootPane();
        // 设置场景
        Scene scene = new Scene(root, 1000, 800);

        scene.getStylesheets().add(getClass().getResource("styles.css").toExternalForm()); // 加载 CSS 文件
        stage.setScene(scene);
        stage.setTitle("图片浏览器");
        stage.setOnCloseRequest(event -> {
            if (root.getTask() != null && root.getTask().isRunning()) {
                root.getTask().cancel();
                root.getExecutor().shutdown();
                Platform.exit();
            }
        });
        stage.show();
    }
    public static void main(String[] args) {
        launch(args);
    }
}

